package zhaolu.com.example.Delicacy.MySQL;

import zhaolu.com.example.Delicacy.Entity.Order;

public class OrderDAO extends MySQLHelper {
    public static int addOrder(Order item) {
        int row = 0;
        try {
            getConnection();
            String sql = "call add_order(?, ?)";
            callableStatement = connection.prepareCall(sql);
            callableStatement.setString(1, item.getIdCustomer());
            callableStatement.setInt(2, item.getIdFood() + 1);
            callableStatement.execute();
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
            closeAll();
        }
        return row;
    }
}
